<?php
/**
 *
 * @author wangtao
 * @version 
 */
header('HTTP/1.1 503 Service Unavailable');exit;
define('IN_WT', true);
include 'include.php';
include 'config.php';

$wd = http::get('wd');
$sn = http::get('sn') ? http::get('sn') : 10;
$db = mysqlDB::con();
#初始化模板
$views = new smasrty();
$countSQL = 'SELECT `Pid` FROM `post_into` WHERE `Post_Title` LIKE \'%' . $wd . '%\'';
$conutNum = $db->queryNum($countSQL);
$conutNum = $conutNum > $sn ? $conutNum - $sn : $conutNum;
$st = http::get('st') ? $st = http::get('st') : $conutNum;
$start = $st > $sn ? $st : 0;
$url = '/search.php?wd=' . $wd;
$page = http::searchPageF($conutNum, $start, $url);
$post = array_reverse(wt_search::so($wd, 10, $start));
$title = '搜索_' . $wd;
$views -> assign('key', $wd);
$views -> assign('title', $title);
$views -> assign('post', $post);
$views -> assign('pager', $page);
$views -> assign('countNUM', $conutNum);
$views -> assign('WEBROOT', WEBROOT);
$views -> display('main.html');